# print("python")
#
#     print("java")


# f()
#
#
# def f():
#     print("f")


# i = 10
# j = 0
#
# print(i / j)
#
#
# print(a)


# l = [1, 2, 3, 4, 5, 6, 8]
#
# print(l[100])

# t = (1, 2, 3, 4, 5, 6)
#
# t.append(10)


try:
    print("正常代码")
    l = [1, 2, 3]
    print(l[4])
    print(10 / 0)
    print("111")

except ZeroDivisionError as e:  # 捕获异常
    print("出现异常执行的代码")
    print(e)

except IndexError as c:
    print("其它异常")
    print(c)

else:
    print("正常市执行")

finally:
    print("无论是否发生异常都会执行")

# 手动抛出异常
raise RuntimeError("运行时异常")

print("end")
